home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / hity wydania / trueSpace 7.6 / tS761B8Std.exe / {app} / Scripts / MaterialEditor / Bricks / Compound / ThresholdHatching.Brick.xml < prev   
Extensible Markup Language  |  2008-06-10  |  2KB  |  36 lines

  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <ME_BRICK GUID="{EA23D62B-19A8-4c84-BADD-BE74BD008E61}" Name="RtTSHatcher" GUIName="Hatching NPR" Description="The hatching non photo realistic rendering">
  3.     <ME_BRICK_INPUTPARAM GUID="{3420C33D-5629-4012-A1BF-45A52D835D74}" Name="Intensity" Type="RtFloat4"/>
  4.     <ME_BRICK_INPUTPARAM GUID="{09C0EEDF-B910-4ac9-B796-8E94E08C99B3}" Name="Texcoords" Type="RtFloat3"/>
  5.     <ME_BRICK_INPUTPARAM GUID="{B481FAEC-EAAB-44b1-A551-135FC03E3374}" Name="HatchingTexture" Type="RtSampler2D"/>
  6.     <ME_BRICK_OUTPUTPARAM GUID="{C30236E3-8E0A-4b83-881D-86B32F33CB64}" Name="ResultColor" Type="RtFloat4"/>
  7.     <ME_BRICK_CODE><![CDATA[
  8.     void RtTSHatcher(in RtFloat4 Intensity, in RtFloat3 Texcoords, 
  9.                      in RtSampler2D HatchingTexture, out RtFloat4 ResultColor)
  10.     {
  11.         //ResultColor = RtFloat4(0,0,0,0);
  12.         float StrokeIntensity = 0.0f;
  13.  
  14.         float2 offset00 = float2(0.28, 0.38);
  15.         float2 offset01 = float2(0.26, 0.22);
  16.         
  17.         float2 Tex0 = Texcoords.xy;
  18.         float2 Tex1 = Tex0.xy + offset00;
  19.         float2 Tex2 = Tex0.xy + offset01;
  20.  
  21.         float4 stroke1 = tex2D(HatchingTexture, Tex0);
  22.         StrokeIntensity = (Intensity < 5.0/7.0 + stroke1.w/7.0) ? stroke1.x : 1.0f;
  23.         StrokeIntensity *= (Intensity < 2.0/7.0 + stroke1.z/7.0) ? stroke1.y : 1.0f;
  24.  
  25.         float4 stroke2 = tex2D(HatchingTexture, Tex1);
  26.         StrokeIntensity *= (Intensity < 4.0/7.0 + stroke2.w/7.0) ? stroke2.x : 1.0f;
  27.         StrokeIntensity *= (Intensity < 1.0/7.0 + stroke2.z/7.0) ? stroke2.y : 1.0f;
  28.  
  29.         float4 stroke3 = tex2D(HatchingTexture, Tex2);
  30.         StrokeIntensity *= (Intensity < 3.0/7.0 + stroke3.w/7.0) ? stroke3.x : 1.0f;
  31.         StrokeIntensity *= (Intensity < 0.0/7.0 + stroke3.z/7.0) ? stroke3.y : 1.0f;
  32.         ResultColor = StrokeIntensity * Intensity;
  33.     }
  34.     ]]></ME_BRICK_CODE>
  35. </ME_BRICK>
  36.